package com.kehutong.admin.entity.db;

import org.coraframework.orm.Entity;
import org.coraframework.orm.annotation.Column;
import org.coraframework.orm.annotation.Table;
import org.coraframework.orm.util.IDType;

@Table(value="t_database", comment="数据库池", idType=IDType.TIMESTAMP)
public class Database extends Entity {

	private static final long serialVersionUID = 2266015772148179724L;

	protected Database(String id) {
		super(id);
	}
	
	@Column(length=64, comment="数据库名称")
	private String name;
	
	@Column(length=255, comment="数据库url链接")
	private String url;
	
	@Column(comment="数据库账号")
	private String username;
	
	@Column(comment="数据库密码")
	private String password;
	
	@Column(comment="最小连接数")
	private int minimumSize;

	@Column(comment="最大连接数")
	private int maximumSize;

	@Column(comment="每次增长数量")
	private int acquireIncrement;

	@Column(comment="重试等待时间")
	private int acquireRetryDelay;
	
	@Column(comment="使用客户数量")
	private int customerCount;
	
	@Column(comment="逻辑删除")
	private boolean deleted;
	
	@Column(comment="修改者")
	private String update_by;

	@Column(comment="创建者")
	private String create_by;

	@Column(defValue = "NOT NULL default 'product' ", comment="类型，product：正式，trial：试用")
	private String type;

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public int getMinimumSize() {
		return minimumSize;
	}

	public void setMinimumSize(int minimumSize) {
		this.minimumSize = minimumSize;
	}

	public int getMaximumSize() {
		return maximumSize;
	}

	public void setMaximumSize(int maximumSize) {
		this.maximumSize = maximumSize;
	}

	public int getAcquireIncrement() {
		return acquireIncrement;
	}

	public void setAcquireIncrement(int acquireIncrement) {
		this.acquireIncrement = acquireIncrement;
	}

	public int getAcquireRetryDelay() {
		return acquireRetryDelay;
	}

	public void setAcquireRetryDelay(int acquireRetryDelay) {
		this.acquireRetryDelay = acquireRetryDelay;
	}

	public int getCustomerCount() {
		return customerCount;
	}

	public void setCustomerCount(int customerCount) {
		this.customerCount = customerCount;
	}
	
	public void addCustomerCount(int count) {
		this.customerCount += count;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	public String getUpdate_by() {
		return update_by;
	}

	public void setUpdate_by(String update_by) {
		this.update_by = update_by;
	}

	public String getCreate_by() {
		return create_by;
	}

	public void setCreate_by(String create_by) {
		this.create_by = create_by;
	}
}
